﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SPMS.Utility;

namespace SPMS.Log.Configuration
{
    /// <summary>
    /// 属性值
    /// </summary>
    /// <remarks>用于描述属性值</remarks>
    /// <history>
    /// [zanezeng]               2009/10/15 15:02    创建
    /// </history>
    public sealed class PropertyValue
    {
        #region ---Constructor

        /// <summary>
        /// 初始化类型<see cref="PropertyValue"/>的新实例
        /// </summary>
        /// <param name="name">属性名称</param>
        /// <param name="value">属性值</param>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="name"/>为<c>Null</c>或者为空字符串</exception>
        /// <history>
        /// [zanezeng]               2009/10/15 15:02    创建
        /// </history>
        public PropertyValue( string name, object value )
        {
            //断言参数
            ArgumentAssert.AssertStringArgumentNotNullOrEmpty( name, "name" );

            //保存参数
            this.m_Name = name;
            this.m_Value = value;
        }

        #endregion

        #region ---Property

        /// <summary>
        /// 获得属性名称
        /// </summary>
        /// <value>属性名称</value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/15 15:05    创建
        /// </history>
        public string Name
        {
            get
            {
                return this.m_Name;
            }
        }

        /// <summary>
        /// 获得属性的值
        /// </summary>
        /// <value>属性的值</value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/15 15:06    创建
        /// </history>
        public object Value
        {
            get
            {
                return this.m_Value;
            }
        }

        #endregion

        #region ---Field

        /// <summary>
        /// 属性名称
        /// </summary>
        private string m_Name;

        /// <summary>
        /// 属性值
        /// </summary>
        private object m_Value;

        #endregion
    }
}
